package com.laiketui.order.api.enums;

public enum BalanceRecordTypeEnum {
    /**
     * 冻结金额
     */
    FREEZE_AMOUNT(1, "冻结中"),
    /**
     * 已失效(解冻)
     */
    UNFREEZE(2, "已失效"),
    /**
     * 扣除金额
     */
    DEDUCT(3, "已出账"),
    /**
     * 充值金额
     */
    RECHARGE(4, "已入账");
    /**
     * 充值金额
     */
//    FREEZE_DEDUCT(5, "已失效");

    private Integer code;

    private String name;

    BalanceRecordTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String getName(int code) {
        for (BalanceRecordTypeEnum value : BalanceRecordTypeEnum.values()) {
            if (value.getCode() == code) {
                return value.getName();
            }
        }
        return null;
    }
}
